 
//验证码银行卡号
	function luhmCheck(bankno) {
	    var lastNum = bankno.substr(bankno.length - 1, 1); //取出最后一位（与luhm进行比较）
	    var first15Num = bankno.substr(0, bankno.length - 1); //前15或18位
	    var newArr = new Array();
	    for (var i = first15Num.length - 1; i > -1; i--) { //前15或18位倒序存进数组
	        newArr.push(first15Num.substr(i, 1));
	    }
	    var arrJiShu = new Array(); //奇数位*2的积 <9
	    var arrJiShu2 = new Array(); //奇数位*2的积 >9
	    var arrOuShu = new Array(); //偶数位数组
	    for (var j = 0; j < newArr.length; j++) {
	        if ((j + 1) % 2 == 1) { //奇数位
	            if (parseInt(newArr[j]) * 2 < 9) arrJiShu.push(parseInt(newArr[j]) * 2);
	            else arrJiShu2.push(parseInt(newArr[j]) * 2);
	        } else //偶数位
	        arrOuShu.push(newArr[j]);
	    }
	 
	    var jishu_child1 = new Array(); //奇数位*2 >9 的分割之后的数组个位数
	    var jishu_child2 = new Array(); //奇数位*2 >9 的分割之后的数组十位数
	    for (var h = 0; h < arrJiShu2.length; h++) {
	        jishu_child1.push(parseInt(arrJiShu2[h]) % 10);
	        jishu_child2.push(parseInt(arrJiShu2[h]) / 10);
	    }
	 
	    var sumJiShu = 0; //奇数位*2 < 9 的数组之和
	    var sumOuShu = 0; //偶数位数组之和
	    var sumJiShuChild1 = 0; //奇数位*2 >9 的分割之后的数组个位数之和
	    var sumJiShuChild2 = 0; //奇数位*2 >9 的分割之后的数组十位数之和
	    var sumTotal = 0;
	    for (var m = 0; m < arrJiShu.length; m++) {
	        sumJiShu = sumJiShu + parseInt(arrJiShu[m]);
	    }
	 
	    for (var n = 0; n < arrOuShu.length; n++) {
	        sumOuShu = sumOuShu + parseInt(arrOuShu[n]);
	    }
	 
	    for (var p = 0; p < jishu_child1.length; p++) {
	        sumJiShuChild1 = sumJiShuChild1 + parseInt(jishu_child1[p]);
	        sumJiShuChild2 = sumJiShuChild2 + parseInt(jishu_child2[p]);
	    }
	    //计算总和
	    sumTotal = parseInt(sumJiShu) + parseInt(sumOuShu) + parseInt(sumJiShuChild1) + parseInt(sumJiShuChild2);
	 
	    //计算Luhm值
	    var k = parseInt(sumTotal) % 10 == 0 ? 10 : parseInt(sumTotal) % 10;
	    var luhm = 10 - k;
	 
	    if (lastNum == luhm) {
	        return true;
	    } else {
				
	        return false;
	    }
	}
	//将时间戳转换成正常时间格式
	    function timestampToTime(timestamp) {
	        var date = new Date(timestamp * 1000);//时间戳为10位需*1000，时间戳为13位的话不需乘1000
	        var Y = date.getFullYear() + '-';
	        var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
	        var D = date.getDate() + ' ';
	        var h = date.getHours() + ':';
	        var m = date.getMinutes() + ':';
	        var s = date.getSeconds();
	        return Y+M+D+h+m+s;
	    }
		
		function GetPercent(num, total) {
		    /// <summary>
		    /// 求百分比
		    /// </summary>
		    /// <param name="num">当前数</param>
		    /// <param name="total">总数</param>
		    num = parseFloat(num);
		    total = parseFloat(total);
		    if (isNaN(num) || isNaN(total)) {
		        return "-";
		    }
		  return total <= 0 ? "0%" : (Math.round(num / total * 10000) / 1.00);
		}
		
		
		//点击查看大图
		    function previewImg(obj) {
		  var Imgdata =$(obj).data('src');
		if(Imgdata){
			  var imgHtml = "<img src='" + Imgdata + "' width='100px' height='100px' style='width:100%;height:100%'/>";
			  // 弹出层
			  layer.open({
			      type: 1,
			      shade: 0.8,
			      offset: 'auto',
			      // area: [100 + 'px',100+'px'], // area: [width + 'px',height+'px'] //原图显示
			      shadeClose:true,
			      scrollbar: true,
			      title: "打款截图", //不显示标题
			      content: imgHtml, //捕获的元素，注意：最好该指定的元素要存放在body最外层，否则可能被其它的相对元素所影响
			      cancel: function () {
			          //layer.msg('捕获就是从页面已经存在的元素上，包裹layer的结构', { time: 5000, icon: 6 });
			      }
			  });
			
		}
		    
		    }
		//使用jQuery的scroll()方法来监听页面滚动
// H5 plus事件处理
function plusReady(){
	// 获取系统状态栏背景
	var rgb = plus.navigator.getStatusBarBackground();
	console.log('StatusBarBackground：'+rgb);
}
if(window.plus){
	plusReady();
}else{
	document.addEventListener('plusready', plusReady, false);
}